<template>
	<view class="pug-course-list">
		<view class="item" @click="toLink(item.id)" v-for="(item,index) in dataList" :key="item.id">
			<u-image radius="12rpx" width="245rpx" height="90px" :src="item.img"></u-image>
			<view class="pug-content">
				<view class="pug-title-content">
					<text class="title">{{item.title}}</text>
					<text class="description">{{item.description}}</text>
				</view>
				<text class="price">￥{{item.realprice}} 分佣价格：￥{{item.commission}}</text>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		name:"pug-course-list",
		props:{
			dataList: {
				type: Array,
				default: []
			}
		},
		data() {
			return {
				
			};
		},
		methods:{
			toLink(courseId){
				uni.navigateTo({
					url: "/pages/coursedetail/coursedetail?courseId=" + courseId
				})
			}
		}
	}
</script>

<style lang="scss">
	.pug-course-list{	
		padding: 20rpx 30rpx 30rpx 30rpx;
		.item{
			display: flex;
			padding: 30rpx 0;
			border-bottom: 1px solid #f2f2f2;
			&:first-child{
				border-top: 4px solid #f2f2f2;
			}
			.pug-content{
				margin-left: 20rpx;
				display: flex;
				flex-direction: column;
				justify-content: space-between;
				.pug-title-content{
					.title{
						font-size: 28rpx;
						color: #333;
						
						overflow: hidden;
						text-overflow: ellipsis;
						display: -webkit-box;
						-webkit-line-clamp: 1;
						-webkit-box-orient: vertical;
					}
					.tags{
						word-break: break-word;
						font-size: 22rpx;
						color: #666;
						margin-top: 7rpx;
					}
					.description{
						margin-top: 10rpx;
						font-size: 24rpx;
						color: #666;
						text-align: justify;
						overflow: hidden;
						text-overflow: ellipsis;
						display: -webkit-box;
						-webkit-line-clamp: 2;
						-webkit-box-orient: vertical;
					}
				}
				.price{
					color: #ff0000;
					font-size: 26rpx;
				}
			}
			
		}
		
	}
</style>